﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using OnlineGameClient.Service;
using OnlineGameLibrary.Contract;
using OnlineGameClient.ViewModel;

namespace OnlineGameClient.View
{
    public partial class GameConfigView : ChildWindow,IModalWindow
    {
        public GameConfigView()
        {
            InitializeComponent();
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (configview2.ValidateConfig())
            {
                var config = configview2.GetGameConfig();
                var vm = this.DataContext as GameConfigViewModel;
                vm.GameConfig = config;

                this.DialogResult = true;
            }
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
           
        }
    }
}

